<template>
    <div style="border: 1px solid #eee">
        <el-row style="margin: 20px">NetWork日志</el-row>
        <textarea style="width: 99%; height: 500px;" readonly v-model="netlog"></textarea>
    </div>
</template>

<script>
    import axios from 'axios'
    export default {
        name: "NetWorkLog",
        data(){
            return {
                timer: 0,
                netlog: ""
            }
        },
        methods: {
            getNetLog(){
                axios({
                    method: 'get',
                    url: '/text/gethost',
                }).then(res => {
                    this.netlog = res.data;
                })
            }
        },
        created() {
            this.timer = setInterval(this.getNetLog, 1000);
        },
        beforeDestroy() {
            clearInterval(this.timer);
        }
    }
</script>

<style scoped>

</style>